package com.springinpractice.ch07.model;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.apache.jackrabbit.ocm.mapper.impl.annotation.Collection;
import org.apache.jackrabbit.ocm.mapper.impl.annotation.Field;
import org.apache.jackrabbit.ocm.mapper.impl.annotation.Node;

@Node
public class Article
{
	@Field
	private String id;
	@Field(path = true)
	private String path;
	@Field
	private String title;
	@Field
	private String author;
	@Field
	private String description;
	@Field
	private String keywords;
	@Field
	private Date dateCreated;
	@Field
	private Date datePublished;
	@Collection
	private final List<Page> pages = new ArrayList<Page>();

	public String getId()
	{
		return id;
	}

	public void setId(String id)
	{
		this.id = id;
	}

	public List<Page> getPages()
	{
		return pages;
	}

	public void setPages(List<Page> pages)
	{
		this.pages.clear();
		this.pages.addAll(pages);
	}

	public void setPath(String path)
	{
		this.path = path;
	}

	public String getPath()
	{
		return path;
	}

	public void setTitle(String title)
	{
		this.title = title;
	}

	public String getTitle()
	{
		return title;
	}

	public void setAuthor(String author)
	{
		this.author = author;
	}

	public String getAuthor()
	{
		return author;
	}

	public void setDescription(String description)
	{
		this.description = description;
	}

	public String getDescription()
	{
		return description;
	}

	public void setKeywords(String keywords)
	{
		this.keywords = keywords;
	}

	public String getKeywords()
	{
		return keywords;
	}

	public void setDateCreated(Date dateCreated)
	{
		this.dateCreated = dateCreated;
	}

	public Date getDateCreated()
	{
		return dateCreated;
	}

	public void setDatePublished(Date datePublished)
	{
		this.datePublished = datePublished;
	}

	public Date getDatePublished()
	{
		return datePublished;
	}

}
